package com.itheima.test02;

import com.itheima.test02.config.SpringConfig2;
import com.itheima.test02.pojo.User;
import com.itheima.test02.service.IUserService;
import com.itheima.test02.service.OrderSerivce;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class test02 {
    @Test
    public void test() {
        AnnotationConfigApplicationContext ioc = new AnnotationConfigApplicationContext(SpringConfig2.class);
        IUserService service = ioc.getBean(IUserService.class);
        service.getUser();
    }

    @Test
    public void test2() {
        AnnotationConfigApplicationContext ioc = new AnnotationConfigApplicationContext(SpringConfig2.class);
        System.out.println( ioc.getBean(OrderSerivce.class));
    }

    @Test
    public void test3() {
        AnnotationConfigApplicationContext ioc = new AnnotationConfigApplicationContext(SpringConfig2.class);
        User user = ioc.getBean(User.class);
        System.out.println(user);
    }
}
